package com.taoyige.bean;

import java.io.InputStream;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.taoyige.common.JacksonJsonUtil;

/**
 * 微信认证信息类：OAuth认证返回的数据集
 * @author peter
 * @version 1.0
 * @created 2014-11-12
 */
@JsonIgnoreProperties(ignoreUnknown=true)
public class WXAccessInfo 
{
	
    public static final String WX_ACCESSINFO_OPENID           = "openid";
    public static final String WX_ACCESSINFO_ACCESS_TOKEN  = "access_token";
    public static final String WX_ACCESSINFO_EXPIRES_IN    = "expires_in";
    public static final String WX_ACCESSINFO_REFRESH_TOKEN    = "refresh_token";
    public static final String WX_ACCESSINFO_SCOPE    = "scope";
    
	private String openid;
	private String access_token;
	private Long expires_in;
	private String refresh_token;
	private String scope;
	
	
	public String getAccess_token() {
		return access_token;
	}
	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}
	public String getOpenid() {
		return openid;
	}
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	public Long getExpires_in() {
		return expires_in;
	}
	public void setExpires_in(Long expires_in) {
		this.expires_in = expires_in;
	}
	public String getRefresh_token() {
		return refresh_token;
	}
	public void setRefresh_token(String refresh_token) {
		this.refresh_token = refresh_token;
	}
	public String getScope() {
		return scope;
	}
	public void setScope(String scope) {
		this.scope = scope;
	}
	
	public static WXAccessInfo  parse(InputStream ins) throws Exception {
		WXAccessInfo wx = (WXAccessInfo) JacksonJsonUtil.jsonToBean(ins, WXAccessInfo.class);
		return wx;
	}
	
	
}